package com.xckj.cycling.utils

import java.io.File

object FileUtils {

    fun createFolder(userWalletPath:String):File {
        val folder = File(userWalletPath)

        if (!folder.exists()) {
            folder.mkdirs() // 创建文件夹，包括所有必要的父文件夹
        }
        return folder
    }

    fun isDirectoryEmpty(directoryPath: String): Boolean {
        val directory = File(directoryPath)
        return directory.listFiles()?.isEmpty() ?: true
    }

    fun deleteFile(userWalletPath:String){
        val folder = File(userWalletPath)
        if(folder.exists()){
            folder.delete()
        }
    }

}